package com.lzw.service;

import com.aliyuncs.IAcsClient;
import com.aliyuncs.alidns.model.v20150109.DescribeDomainRecordsRequest;
import com.aliyuncs.alidns.model.v20150109.DescribeDomainRecordsResponse;
import com.aliyuncs.alidns.model.v20150109.UpdateDomainRecordRequest;
import com.aliyuncs.alidns.model.v20150109.UpdateDomainRecordResponse;

import java.util.List;

/**
 * @author liuzw
 * @date 2021/10/29
 */
public interface IDNSService {

    /**
     * 获取当前机器公网IP
     *
     * @return ip
     */
    String getCurrentHostIp();

    DescribeDomainRecordsResponse.Record describeDomainRecordsOne(DescribeDomainRecordsRequest request, IAcsClient client);

    /**
     * 获取主机修改记录
     *
     * @param request 查询域名封装信息
     * @param client  实例链接
     * @return 最新一条记录
     */
    List<DescribeDomainRecordsResponse.Record> describeDomainRecords(DescribeDomainRecordsRequest request, IAcsClient client);

    UpdateDomainRecordResponse updateDomainRecord(UpdateDomainRecordRequest request, IAcsClient client);

    void updateDomainRecord(String type, String ip);
}
